﻿CREATE PROCEDURE [dbo].[ContactDetail_Insert]

@CreatedBy uniqueidentifier
, @ModifiedBy uniqueidentifier
, @HomeNumber varchar (24)
, @MobileNumber varchar (24)
, @WorkNumber varchar (24)
, @FaxNumber varchar (24)
, @EmailAddress varchar (128)
AS
BEGIN
SET NOCOUNT ON

DECLARE @CreatedDate datetime
DECLARE @ModifiedDate datetime
DECLARE @Deleted bit
DECLARE @ContactDetailID uniqueidentifier
SET @CreatedDate = GETDATE()
SET @ModifiedDate = GETDATE()
SET @Deleted = 0
SET @ContactDetailID = NEWID()

INSERT INTO [dbo].[ContactDetail] ([ContactDetailID]
, [CreatedDate]
, [CreatedBy]
, [ModifiedDate]
, [ModifiedBy]
, [Deleted]
, [HomeNumber]
, [MobileNumber]
, [WorkNumber]
, [FaxNumber]
, [EmailAddress]
)
VALUES (@ContactDetailID
, @CreatedDate
, @CreatedBy
, @ModifiedDate
, @ModifiedBy
, @Deleted
, @HomeNumber
, @MobileNumber
, @WorkNumber
, @FaxNumber
, @EmailAddress
)

SELECT @ContactDetailID [ContactDetailID]
END
